package com.ruanyun.tio.net.common;

import com.ruanyun.tio.net.common.command.Command;
import org.tio.core.intf.Packet;

/**
 * @author tanyaowu
 */
public class PacketVo extends org.tio.core.intf.Packet {

	/**
	 * 
	 */
	private static final long serialVersionUID = -5307898399690521264L;
	
	private Command command;
	
	public Command getCommand() {
		return command;
	}

	public void setCommand(Command command) {
		this.command = command;
	}


    public static final int HEADER_LENGTH = 4;//消息头的长度
    public static final String CHARSET = "utf-8";

    /**
     * 消息类型，其值在org.tio.examples.showcase.common.Type中定义
     */
//    private byte type;

    private byte[] body;

    public PacketVo() {
        super();
    }

    /**
//     * @param type
     * byte type,
     * @param body
     * @author tanyaowu
     */
    public PacketVo(byte[] body) {
        super();
//        this.type = type;
        this.body = body;
    }

    /**
     * @return the body
     */
    public byte[] getBody() {
        return body;
    }

//    /**
//     * @return the type
//     */
//    public byte getType() {
//        return type;
//    }
//
//    @Override
//    public String logstr() {
//        return "" + type;
//    }

    /**
     * @param body the body to set
     */
    public void setBody(byte[] body) {
        this.body = body;
    }

//    /**
//     * @param type the type to set
//     */
//    public void setType(byte type) {
//        this.type = type;
//    }
	
}
